<template>
  <div class="tabs-group">
    <el-scrollbar style="height: 100%">
      <div class="tabs-btns">
        <button v-for="(btn, bIndex) in tabsButtons" @click="onClick(btn, bIndex)" :class="{ actived: bIndex == index }"
          :key="bIndex">
          <i :class="btn.icon"></i>
          {{ btn.name }}
        </button>
      </div>
      <keep-alive>
        <component ref="com" v-bind:is="currentComponent"></component>
      </keep-alive>
      <el-row type="flex" justify="center" align="middle" style="height: 100vh">
        <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4">
          <el-button type="warning" class="edit_btn" @click="btnStaging"
            style="background: #e6a23c 80%; border: #e6a23c">暂存</el-button>&nbsp;&nbsp;&nbsp;&nbsp;
          <el-button type="primary" class="edit_btn" @click="btnSubmit">提交申请</el-button>
        </el-col>
      </el-row>
    </el-scrollbar>
  </div>
</template>
<script>
import ssfa from "@/views/upload/ssfa";
import jcbg from "@/views/upload/jcbg";
import zjbg from "@/views/upload/zjbg";
import ljjl from "@/views/upload/ljjl";
import wydcjl from "@/views/upload/wydcjl";
import jjbg from "@/views/upload/jjbg";
import djsjy from "@/views/upload/djsjy";
import wth from "@/views/upload/wth";
import cyd from "@/views/upload/cyd";
import chzlyy from "@/views/upload/chzlyy";
//注意必看，App_Appointment与App_Transaction是自动生成的页面，在页签引用时需要指定表名权限，否则普通帐号打开页面会出现401
//具体指定权限方式见：App_Appointment.js与App_Transaction.js中的tableAction属性
export default {
  components: {
    ssfa,
    jcbg,
    zjbg,
    ljjl,
    wydcjl,
    jjbg,
    djsjy,
    wth,
    cyd,
    chzlyy,
  },

  data() {
    return {
      index: 0,
      currentComponent: "",
      open: false,
      tabsButtons: [],
      projectname: "",
      ssfa: "",
      jcbg: "",
      zjbg: "",
      yjfileInfo: "",
      ljfileInfo: "",
      wydcjl: "",
      jjbg: "",
      djsjy: "",
      wth: "",
      cyd: "",
      chzlyy: "",
      ssfaValue: "",
      jcbgValue: "",
      zjbgValue: "",
      wydcjlValue: "",
      jjbgValue: "",
      jccwwxgsmValue: "",
      djsjyValue: "",
      wthValue: "",
      cydValue: "",
      chzlyyValue: "",
      ssfaName: "",
      jcbgName: "",
      zjbgName: "",
      wydcjlName: "",
      jjbgName: "",
      jccwwxgsmName: "",
      djsjyName: "",
      wthName: "",
      cydName: "",
      chzlyyName: "",
      yj_file_name: "",
      yj_file_path: "",
      lj_file_path: "",
      lj_file_name: "",
      stagingState: 0,
      projectcount: 0,
      auidtlist: null,
      userInfo: null,
    };
  },

  created() {
    this.http.post("/api/user/getCurrentUserInfo", {}, true).then((x) => {
      if (!x.status) {
        return this.$message(x.message);
      }
      console.log("ce111", x.data);
      this.userInfo = x.data;
      if (x.data.workUnit === null || x.data.workUnit === "") {
        this.$alert("请先完善个人基本信息！", "消息提示", {
          confirmButtonText: "确定",
          type: "error",
          callback: (action) => {
            this.$router.push("/UserInfo");
            return;
          },
        });
      } else {

          // 在获取用户信息后再设置tabsButtons
       this.initTabsButtons();
        //判断当前作业单位是否存在暂存的记录
        this.$store.state.data_id = "";
        this.$store.state.ljchecked = "";
        this.$store.state.yjchecked = "";
        this.http
          .post("/api/zm_data_record/GetWorkUnitByState", {}, true)
          .then((x) => {
            if (!x.Status) {
              return this.$message(x.message);
            }

            if (x.Data.data === "") {
              this.http
                .post("/api/zm_data_record/GetProjectCount", {}, true)
                .then((k) => {
                  console.log(k);
                  if (!k.Status) {
                    return this.$message(k.message);
                  }
                  this.projectname = k.Data.projectname;

                  this.$store.state.projectname = k.Data.projectname;
                  this.$store.state.filelist = []; //上传文件集合
                  this.projectcount = k.Data.Count + 1;
                  this.$alert(this.projectname, "项目名称", {
                    confirmButtonText: "确定",
                    type: "suceess",
                    callback: (action) => {
                      if (
                        k.Data.auditlist != null &&
                        k.Data.auditlist[0] != null
                      ) {
                        this.auidtlist = k.Data.auditlist[0];
                        if (k.Data.auditlist[0].shzt === 0) {
                          var mssgage = "";
                          if (k.Data.auditlist[0].ssfa_sh_state === 0) {
                            mssgage += "实施方案、";
                          }
                          if (k.Data.auditlist[0].jcbg_sh_state === 0) {
                            mssgage += "检查报告、";
                          }
                          if (k.Data.auditlist[0].zjbg_sh_state === 0) {
                            mssgage += "总结报告、";
                          }
                          if (
                            k.Data.auditlist[0].lj_state === 0 ||
                            k.Data.auditlist[0].yj_state === 0
                          ) {
                            mssgage += "两级检查记录、";
                          }
                          if (k.Data.auditlist[0].wydcjl_sh_state === 0) {
                            mssgage += "外业调查核查记录表、";
                          }
                          if (
                            k.Data.auditlist[0].jjbg_sh_state === 0 ||
                            k.Data.auditlist[0].jccwwxgsm_sh_state === 0
                          ) {
                            mssgage += "机检记录、";
                          }
                          if (k.Data.auditlist[0].djsjy_sh_state === 0) {
                            mssgage += "地市级交验、";
                          }
                          // if (k.Data.auditlist[0].wth_sh_state === 0) {
                          //   mssgage += "委托函、";
                          // }
                          // if (k.Data.auditlist[0].cyd_sh_state === 0) {
                          //   mssgage += "抽样单、";
                          // }
                          if (k.Data.auditlist[0].chzlyy_sh_state === 0) {
                            mssgage += "测绘资料交验移交清单";
                          }
                          if (mssgage != "") {
                            mssgage = mssgage.substring(0, mssgage.length - 1);
                          }
                          console.log(mssgage);
                          this.$alert(
                            mssgage +
                            "上次审核不通过，审核不通过的必须上传，其他审核通过的文件可不上传！",
                            "消息提示",
                            {
                              confirmButtonText: "确定",
                              type: "error",
                              callback: (action) => { },
                            }
                          );
                        }
                      }
                    },
                  });
                });
            } else {
              if (x.Data.rest === "") {
                this.$confirm(x.Data.data, "消息提示", {
                  confirmButtonText: "是",
                  cancelButtonText: "否",
                  type: "error",
                  showCancelButton: true, //是否显示取消按钮
                  showClose: true, //是否显示右上角的x
                  closeOnClickModal: false, //是否可以点击空白处关闭弹窗
                })
                  .then(() => {
                    var parms = [];
                    parms.push(x.Data.id);
                    this.http
                      .post("/api/zm_data_record/Del", parms)
                      .then((result) => {
                        this.$store.state.filelist = []
                      });
                  })
                  .catch(() => {
                    this.$router.push("/applyedit?id=" + x.Data.id);
                    this.$store.state.data_id = x.Data.id;

                  });
              } else {
                this.$alert(x.Data.data, "消息提示", {
                  confirmButtonText: "确定",
                  type: "error",
                  callback: (action) => {
                    this.$router.push("/applylist");
                  },
                });
              }
            }
          });
      }
    });
  },
  activated() { },
  methods: {
     initTabsButtons() {
      if(this.userInfo.xzqdm!==null && this.userInfo.xzqdm!=="")
      {
    this.tabsButtons = [
      {
        name: "市县实施方案",
        icon: "el-icon-document",
        component: "ssfa",
      },
      {
        name: "任务区检查报告",
        icon: "el-icon-document",
        component: "jcbg",
      },
      {
        name: "任务区技术总结报告",
        icon: "el-icon-document",
        component: "zjbg",
      },
      {
        name: "两级检查记录",
        icon: "el-icon-document",
        component: "ljjl",
      },
      {
        name: "外业调查核查记录表",
        icon: "el-icon-document",
        component: "wydcjl",
      },
      {
        name: "机检记录",
        icon: "el-icon-document",
        component: "jjbg",
      },
      // {
      //   name: "接边记录表",
      //   icon: "el-icon-document",
      //   component: "djsjy",
      // },
      {
        name: "抽样单",
        icon: "el-icon-document",
        component: "cyd",
      },
      {
        name: "测绘资料交验移交清单",
        icon: "el-icon-document",
        component: "chzlyy",
      },
    ];
      }
      else
      {
         this.tabsButtons = [
      {
        name: "市县实施方案",
        icon: "el-icon-document",
        component: "ssfa",
      },
      {
        name: "任务区检查报告",
        icon: "el-icon-document",
        component: "jcbg",
      },
      {
        name: "任务区技术总结报告",
        icon: "el-icon-document",
        component: "zjbg",
      },
      {
        name: "两级检查记录",
        icon: "el-icon-document",
        component: "ljjl",
      },
      {
        name: "外业调查核查记录表",
        icon: "el-icon-document",
        component: "wydcjl",
      },
      {
        name: "机检记录",
        icon: "el-icon-document",
        component: "jjbg",
      },
      {
        name: "接边记录表",
        icon: "el-icon-document",
        component: "djsjy",
      },
      {
        name: "抽样单",
        icon: "el-icon-document",
        component: "cyd",
      },
      {
        name: "测绘资料交验移交清单",
        icon: "el-icon-document",
        component: "chzlyy",
      },
    ];
      }
    
    // 默认显示第一个页面
    if (this.tabsButtons.length) {
      this.currentComponent = this.tabsButtons[0].component;
      this.getLoad();
    }
  },
    async getLoad() {
      this.http
        .post("/api/zm_data_record/GetProjectCount", {}, true)
        .then((k) => {
          console.log(k);
          if (!k.Status) {
            return this.$message(k.message);
          }
          this.projectname = k.Data.projectname;
        });
      var data_id = this.$route.query.id;
      this.$store.state.data_id = data_id;
      this.id = data_id;
      this.http
        .post(
          "/api/zm_data_record/AdminGetDetaileByID?id=" + data_id)
        .then((result) => {
          if (result.Data.thisdata != undefined) {
            this.$store.state.projectList = result.Data;
            this.$store.state.filelist = []; //上传文件集合
            console.log(result.Data)
            if (result.Data.thisdata.lj_isys_dom === "1" && result.Data.thisdata.lj_jcsjcg != null) {
              this.$store.state.ljchecked = true;
            } else {
              this.$store.state.ljchecked = false;
            }

            if (result.Data.thisdata.yj_isys_dom === "1" && result.Data.thisdata.yj_jcsjcg != null) {
              this.$store.state.yjchecked = true;
            } else {
              this.$store.state.yjchecked = false;
            }

          }
        });
    },
    onClick(item, index) {
      console.log("111");
      if (this.index == index) {
        return;
      }
      this.index = index;
      this.currentComponent = item.component;
      if (this.index - 1 == 0) {
        this.btnNext();
      }
      this.$nextTick(() => {
        // this.ssfa = this.$refs.com.ssfafileInfo;
        // console.log("ssfa", this.$refs.com.ssfafileInfo);
        // if (this.ssfa != undefined) {
        //   var json_value={name:this.ssfa};
        //   this.selectList.push(json_value);
        // }
        // this.jcbg = this.$refs.com.jcbgfileInfo;
        // console.log("jcbg", this.$refs.com.jcbgfileInfo);
        // if (this.jcbg != undefined) {
        //   this.selectList.push(this.jcbg);
        // }
        // this.zjbg = this.$refs.com.zjbgfileInfo;
        // console.log("zjbg", this.$refs.com.zjbgfileInfo);
        // if (this.zjbg != undefined) {
        //   this.selectList.push(this.zjbg);
        // }
        // this.yjfileInfo = this.$refs.com.yjfileInfo;
        // if (this.yjfileInfo != undefined) {
        //   this.selectList.push(this.yjfileInfo);
        // }
        // this.ljfileInfo = this.$refs.com.ljfileInfo;
        // if (this.ljfileInfo != undefined) {
        //   this.selectList.push(this.ljfileInfo);
        // }
        // this.wydcjl = this.$refs.com.wydcjlfileInfo;
        // if (this.wydcjl != undefined) {
        //   this.selectList.push(this.wydcjl);
        // }
        // this.jjbg = this.$refs.com.jjbgfileInfo;
        // if (this.jjbg != undefined) {
        //   this.selectList.push(this.jjbg);
        // }
        // this.jccwwxgsm = this.$refs.com.jccwwxgsmfileInfo;
        // if (this.jccwwxgsm != undefined) {
        //   this.selectList.push(this.jccwwxgsm);
        // }
        // this.djsjy = this.$refs.com.djsjyfileInfo;
        // if (this.djsjy != undefined) {
        //   this.selectList.push(this.djsjy);
        // }
        // this.wth = this.$refs.com.wthfileInfo;
        // console.log("wth", this.$refs.com.wthfileInfo);
        // if (this.wth != undefined) {
        //   this.selectList.push(this.wth);
        // }
        // this.cyd = this.$refs.com.cydfileInfo;
        // console.log("cyd", this.$refs.com.cydfileInfo);
        // if (this.cyd != undefined) {
        //   this.cyd = this.$refs.com.cydfileInfo;
        // }
        // this.chzlyy = this.$refs.com.chzlyyfileInfo;
        // if (this.chzlyy != undefined) {
        //   this.selectList.push(this.chzlyy);
        // }
      });
      // togglePage.call(this, { item, index });
    },
    btnNext() { },
    btnStaging() {
      console.log(
        "------------btnStaging------------",
        this.$store.state.filelist
      );
      console.log(
        "------------btnStaging------------",
        this.$store.state.filelist.length
      );

      for (var i = 0; i < this.$store.state.filelist.length; i++) {
        var name = this.$store.state.filelist[i].name;
        var item = this.$store.state.filelist[i].data;
        if (name === "ssfa") {
          if (item.length == 1) {
            this.ssfaValue = item[0].path;
            this.ssfaName = item[0].name;
          }
        } else if (name === "jcbg") {
          if (item.length == 1) {
            this.jcbgValue = item[0].path;
            this.jcbgName = item[0].name;
          }
        } else if (name === "zjbg") {
          if (item.length == 1) {
            this.zjbgValue = item[0].path;
            this.zjbgName = item[0].name;
          }
        } else if (name === "yj") {
          var names = "";
          var paths = "";
          console.log("*****yj******", item.length);
          if (item.length > 0) {
            for (var n = 0; n < item.length; n++) {
              var filename = item[n].name;
              var filepath = item[n].path;
              names += filename + "|";
              paths += filepath + "|";
            }
            if (names != "" && paths != "") {
              names = names.substring(0, names.length - 1);
              paths = paths.substring(0, paths.length - 1);
            }
            this.yj_file_name = names;
            this.yj_file_path = paths;
          }
        } else if (name === "lj") {
          var names = "";
          var paths = "";
          if (item.length > 0) {
            for (var n = 0; n < item.length; n++) {
              var filename = item[n].name;
              var filepath = item[n].path;
              names += filename + "|";
              paths += filepath + "|";
            }
            if (names != "" && paths != "") {
              names = names.substring(0, names.length - 1);
              paths = paths.substring(0, paths.length - 1);
            }
            this.lj_file_name = names;
            this.lj_file_path = paths;
          }
        } else if (name === "wydcjl") {
          if (item.length == 1) {
            this.wydcjlValue = item[0].path;
            this.wydcjlName = item[0].name;
          }
        } else if (name === "jjbg") {
          if (item.length == 1) {
            this.jjbgValue = item[0].path;
            this.jjbgName = item[0].name;
          }
        } else if (name === "jccwwxgsm") {
          if (item.length == 1) {
            this.jccwwxgsmValue = item[0].path;
            this.jccwwxgsmName = item[0].name;
          }
        } else if (name === "djsjy") {
          if (item.length == 1) {
            this.djsjyValue = item[0].path;
            this.djsjyName = item[0].name;
          }
        } else if (name === "cyd") {
          if (item.length == 1) {
            this.cydValue = item[0].path;
            this.cydName = item[0].name;
          }
        } else if (name === "wth") {
          if (item.length == 1) {
            this.wthValue = item[0].path;
            this.wthName = item[0].name;
          }
        } else if (name === "chzlyy") {
          if (item.length == 1) {
            this.chzlyyValue = item[0].path;
            this.chzlyyName = item[0].name;
          }
        }
      }
      console.log("***参数***", this.projectname);
      var parms = {
        mainData: {
          projectname: this.projectname,
          ssfa: this.ssfaValue,
          jcbg: this.jcbgValue,
          zjbg: this.zjbgValue,
          wydcjl: this.wydcjlValue,
          jjbg: this.jjbgValue,
          jccwwxgsm: this.jccwwxgsmValue,
          djsjy: this.djsjyValue,
          wth: this.wthValue,
          cyd: this.cydValue,
          chzlyy: this.chzlyyValue,
          ssfa_name: this.ssfaName,
          jcbg_name: this.jcbgName,
          zjbg_name: this.zjbgName,
          wydcjl_name: this.wydcjlName,
          jjbg_name: this.jjbgName,
          jccwwxgsm_name: this.jccwwxgsmName,
          djsjy_name: this.djsjyName,
          wth_name: this.wthName,
          cyd_name: this.cydName,
          chzlyy_name: this.chzlyyName,
          yj_file_path: this.yj_file_path,
          lj_file_path: this.lj_file_path,
          yj_file_name: this.yj_file_name,
          lj_file_name: this.lj_file_name,
          submit_state: 0,
        },
        detailData: null,
        delKeys: null,
      };
      console.log("***参数***", parms);
      this.http.post("/api/zm_data_record/add", parms).then((result) => {
        console.log(result);
        //  this.$message.success(result);
        this.$alert(result.message, "消息提示", {
          confirmButtonText: "确定",
          callback: (action) => {
            console.log("成功");
            // this.$router.push("/applylist");
          },
        });
        //this.$message.success("提交成功，预审意见将在一到两个工作日内完成预审并反馈结果！如有问题，请联系0000-2393993");
      });
    },
    btnSubmit() {
      console.log("------------list------------", this.auidtlist);
      console.log(
        "------------list------------",
        this.$store.state.filelist.length
      );
      var error_msg = [];
      if (this.$store.state.filelist.length > 0) {
        for (var i = 0; i < this.$store.state.filelist.length; i++) {
          var name = this.$store.state.filelist[i].name;
          var item = this.$store.state.filelist[i].data;
          if (name === "ssfa") {
            if (item.length == 1) {
              this.ssfaValue = item[0].path;
              this.ssfaName = item[0].name;
            } else {
              error_msg.push("请上传相关实施方案文件！");
            }
          } else if (name === "zjbg") {
            if (item.length == 1) {
              this.zjbgValue = item[0].path;
              this.zjbgName = item[0].name;
            }
          } else if (name === "jcbg") {
            console.log("this.auidtlist", this.auidtlist);
            if (item.length == 1) {
              this.jcbgValue = item[0].path;
              this.jcbgName = item[0].name;
            } else {
              error_msg.push("请上传相关检查报告！");
            }
          } else if (name === "yj") {
            var names = "";
            var paths = "";
            if (item.length > 0) {
              for (var n = 0; n < item.length; n++) {
                var filename = item[n].name;
                var filepath = item[n].path;
                names += filename + "|";
                paths += filepath + "|";
              }
              if (names != "" && paths != "") {
                names = names.substring(0, names.length - 1);
                paths = paths.substring(0, paths.length - 1);
              }

              this.yj_file_name = names;
              this.yj_file_path = paths;
              console.log("一级记录", item);
            } else {
              error_msg.push("请上传【两级记录】中的一级记录！");
            }
          } else if (name === "lj") {
            var names = "";
            var paths = "";
            if (item.length > 0) {
              console.log("item", item);
              for (var n = 0; n < item.length; n++) {
                var filename = item[n].name;
                var filepath = item[n].path;

                names += filename + "|";
                paths += filepath + "|";
              }
              if (names != "" && paths != "") {
                names = names.substring(0, names.length - 1);
                paths = paths.substring(0, paths.length - 1);
              }
              this.lj_file_name = names;
              this.lj_file_path = paths;
              console.log("二级记录", this.lj_file_path);
            } else {
              error_msg.push("请上传【两级记录】中的二级记录！");
            }
          } else if (name === "wydcjl") {
            if (item.length == 1) {
              this.wydcjlValue = item[0].path;
              this.wydcjlName = item[0].name;
            } else {
              error_msg.push("请上传相关外业调查核查记录表！");
            }
          } else if (name === "jjbg") {
            if (item.length == 1) {
              this.jjbgValue = item[0].path;
              this.jjbgName = item[0].name;
            } else {
              error_msg.push("请上传相关元数据机检记录及错误未修改说明！");
            }
          } else if (name === "jccwwxgsm") {
            if (item.length == 1) {
              this.jccwwxgsmValue = item[0].path;
              this.jccwwxgsmName = item[0].name;
            } else {
              error_msg.push("请上传相关监测数据机检记录及错误未修改说明！");
            }
          } else if (name === "djsjy") {
            if (item.length == 1) {
              this.djsjyValue = item[0].path;
              this.djsjyName = item[0].name;
            } else {
              error_msg.push("请上传地级市交验！");
            }
          } else if (name === "cyd") {
            if (item.length == 1) {
              this.cydValue = item[0].path;
              this.cydName = item[0].name;
            } else {
              error_msg.push("请上传相关抽样单！");
            }
          } else if (name === "wth") {
            if (item.length == 1) {
              this.wthValue = item[0].path;
              this.wthName = item[0].name;
            } else {
              error_msg.push("请上传相关委托函！");
            }
          } else if (name === "chzlyy") {
            if (item.length == 1) {
              this.chzlyyValue = item[0].path;
              this.chzlyyName = item[0].name;
            } else {
              error_msg.push("请上传相关测绘资料交验移交清单！");
            }
          }
        }
      }

      console.log("***userInfo**", this.userInfo);
      var fileType = [];
      if (this.userInfo != undefined && this.userInfo.role_Id === 126) {
        if (this.ssfaValue == null && this.ssfaValue === "") {
          error_msg.push("请上传相关实施方案！");
        }
      } else {
        if (this.ssfaValue == null && this.ssfaValue === "") {
          if (this.zjbgValue == null && this.zjbgValue === "") {
            error_msg.push("请上传相关实施方案或技术总结报告！");
          }
        }
        var fileType = [
          { name: "jcbg", title: "检查报告" },
          { name: "zjbg", title: "技术总结报告" },
          { name: "yj", title: "一级检查记录" },
          { name: "lj", title: "两级检查记录" },
          { name: "wydcjl", title: "外业调查核查记录表" },
          { name: "jjbg", title: "元数据机检记录及错误未修改说明" },
          { name: "jccwwxgsm", title: "监测数据机检记录及错误未修改说明" },
          { name: "cyd", title: "抽样单" },
          { name: "wth", title: "委托函" },
          { name: "chzlyy", title: "测绘资料交验移交清单" },
        ];

        var uploadFileType = [];

        for (var i = 0; i < this.$store.state.filelist.length; i++) {
          var name = this.$store.state.filelist[i].name;
          uploadFileType.push(name);
        }

        let result = fileType.filter((item) => {
          return uploadFileType.every((item1) => {
            return item.name != item1;
          });
        });
        if (result.length > 0) {
          if (this.projectcount === 1) {
            for (var k = 0; k < result.length; k++) {
              this.$message.error("请选择上传相关" + result[k].title + "！");
              return;
            }
          } else {
            for (var k = 0; k < result.length; k++) {
              if (
                this.auidtlist != null &&
                this.auidtlist.jcbg_sh_state === 0 &&
                result[k].name === "jcbg"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
              if (
                this.auidtlist != null &&
                this.auidtlist.zjbg_sh_state === 0 &&
                result[k].name === "zjbg"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
              if (
                (this.auidtlist != null &&
                  this.auidtlist.yj_state === 0 &&
                  result[k].name === "yj") ||
                (this.auidtlist.lj_state === 0 && result[k].name === "lj")
              ) {
                this.$message.error("请选择上传相关两级记录！");
                return;
              }

              if (
                this.auidtlist != null &&
                this.auidtlist.wydcjl_sh_state === 0 &&
                result[k].name === "wydcjl"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
              if (
                this.auidtlist != null &&
                this.auidtlist.jjbg_sh_state === 0 &&
                result[k].name === "jjbg"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
              if (
                this.auidtlist != null &&
                this.auidtlist.jccwwxgsm_sh_state === 0 &&
                result[k].name === "jccwwxgsm"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
              if (
                this.auidtlist != null &&
                this.auidtlist.cyd_sh_state === 0 &&
                result[k].name === "cyd"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
              if (
                this.auidtlist != null &&
                this.auidtlist.wth_sh_state === 0 &&
                result[k].name === "wth"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
              if (
                this.auidtlist != null &&
                this.auidtlist.chzlyy_sh_state === 0 &&
                result[k].name === "chzlyy"
              ) {
                this.$message.error("请选择上传相关" + result[k].title + "！");
                return;
              }
            }
          }
        }
      }
      console.log("错误", error_msg);
      if (error_msg.length > 0) {
        for (var k = 0; k < error_msg.length; k++) {
          this.$message.error("" + error_msg[k] + "！");
        }
        return;
      }
      var parms = {
        mainData: {
          projectname: this.projectname,
          ssfa: this.ssfaValue,
          jcbg: this.jcbgValue,
          zjbg: this.zjbgValue,
          yj_file_path: this.yj_file_path,
          lj_file_path: this.lj_file_path,
          yj_file_name: this.yj_file_name,
          lj_file_name: this.lj_file_name,
          wydcjl: this.wydcjlValue,
          jjbg: this.jjbgValue,
          jccwwxgsm: this.jccwwxgsmValue,
          djsjy: this.djsjyValue,
          wth: this.wthValue,
          cyd: this.cydValue,
          chzlyy: this.chzlyyValue,
          ssfa_name: this.ssfaName,
          jcbg_name: this.jcbgName,
          zjbg_name: this.zjbgName,
          wydcjl_name: this.wydcjlName,
          jjbg_name: this.jjbgName,
          jccwwxgsm_name: this.jccwwxgsmName,
          djsjy_name: this.djsjyName,
          wth_name: this.wthName,
          cyd_name: this.cydName,
          chzlyy_name: this.chzlyyName,
          submit_state: 1,
        },
        detailData: null,
        delKeys: null,
      };
      console.log("***参数***", parms);
      this.http.post("/api/zm_data_record/add", parms).then((result) => {
        console.log("提交", result);
        if (!result.status) {
          this.$alert(result.message, "消息提示", {
            confirmButtonText: "确定",
            callback: (action) => { },
          });
        } else {
          this.$alert(result.message, "消息提示", {
            confirmButtonText: "确定",
            callback: (action) => {
              this.$router.push("/applylist");
            },
          });
        }
      });
    },
  },
};
</script>
<style lang="less" scoped>
.tabs-group {
  position: absolute;
  height: 100%;
  width: 100%;
}

.tabs-btns {
  border-bottom: 1px solid #eee;

  button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    margin-right: 20px;
    position: relative;
    padding: 10px 10px 10px 15px;
  }

  button:after {
    content: "/";
    position: absolute;
    right: -16px;
    bottom: 10px;
    color: #b3b3b3;
  }

  button:last-child:after {
    content: "";
    display: none;
  }

  .actived {
    color: black;
    font-weight: bold;
  }

  .message {
    font-size: 12px;
    color: #a2a19e;
    margin-left: 30px;
  }
}

.edit_btn {
  min-height: 40px;
  min-width: 100px;
  background: #409eff 80%;
  border: #409eff;
  font-size: 20px;
}
</style>